#pragma once
#include "./Header/LogDefine.h"

class LOG_API LogWorker:public std::stringstream
{
public:
    LogWorker(LogWorker&& ref)=delete;
    LogWorker(const LogWorker&& ref)=delete;
    LogWorker& operator=(const LogWorker& oth)=delete;
    LogWorker(LOG_LEVEL level,const char* file,const char* fun,int line);
    ~LogWorker();

    static void setConfigPath(const std::string& conf);
    static void logSwitch(bool open);

private:
    void* hand_;

};

#define LOG_FAT  LogWorker(LOG_LEVEL::LOG_FAT,__FILE__,__FUNCTION__,__LINE__)
#define LOG_ERR  LogWorker(LOG_LEVEL::LOG_ERR,__FILE__,__FUNCTION__,__LINE__)
#define LOG_INF  LogWorker(LOG_LEVEL::LOG_INF,__FILE__,__FUNCTION__,__LINE__)
#define LOG_WAR  LogWorker(LOG_LEVEL::LOG_WAR,__FILE__,__FUNCTION__,__LINE__)
#define LOG_BUG  LogWorker(LOG_LEVEL::LOG_DBUG,__FILE__,__FUNCTION__,__LINE__)


